import React from 'react';
import { Drawer } from 'antd';
import { CloseOutlined } from '#/utils/antdIcons';
import styles from './index.less';
export default function TRDrawer({
  children,
  visible = false,
  title = '',
  width = '730px',
  onClose,
  ...rest
}) {
  return (
    <Drawer
      className={styles.tr_drawer}
      visible={visible}
      closable={false}
      destroyOnClose={true}
      width={width}
      onClose={onClose}
      {...rest}
    >
      <div className={styles.tr_drawer_container}>
        <div className={styles.tr_drawer_head}>
          <div className={styles.tr_drawer_title}>{title}</div>
          <div onClick={onClose}>
            <CloseOutlined className={styles.tr_drawer_close} />
          </div>
        </div>
        <div className={styles.tr_drawer_content}>{children}</div>
      </div>
    </Drawer>
  );
}
